/**
* \brief Implementation of 'Abstract Factory' design pattern.
*	 Header file with auxilliary classes.
* \author Bartosz Kedra (bartosz.kedra@gmail.com)
*/
enum Color { RED, GREEN, BLUE };

class Building
{
public:
	Building(const Color& c): color(c) {}
	virtual ~Building() {}	
private:
	Color color;
};

class Residential : public Building
{
public:
	Residential(const Color& c): Building(c) {}
	virtual Residential* clone(void) const = 0;
};

class Villa : public Residential
{
public:
	Villa(const Color& c): Residential(c) {}
	virtual Residential* clone(void) const { return new Villa(*this); }
};

class BlockOfFlats : public Residential
{
public:
	BlockOfFlats(const Color& c): Residential(c) {}
	virtual Residential* clone(void) const { return new BlockOfFlats(*this); }
};

class Shop : public Building
{
public:
	Shop(const Color& c): Building(c) {}
	virtual Shop* clone(void) const = 0;
};

class Grossery : public Shop
{
public:
	Grossery(const Color& c): Shop(c) {}
	virtual Shop* clone(void) const { return new Grossery(*this); }
};

class Market : public Shop
{
public:
	Market(const Color& c): Shop(c) {}
	virtual Shop* clone(void) const { return new Market(*this); }
};


